//
//  R_Second_Recommend_TableViewCell.swift
//  MyFood
//
//  Created by dllo on 16/2/16.
//  Copyright © 2016年 XRG. All rights reserved.
//

import UIKit

protocol R_Second_Recommend_TableViewCellDelegate{

    func clickSecondTitle()
    func clickSecondImage(num: Int)
    func clickSecond_Movie(num: Int)
}

class R_Second_Recommend_TableViewCell: UITableViewCell {
    var delegate : R_Second_Recommend_TableViewCellDelegate!

    @IBOutlet weak var leftImg: UIImageView!

    @IBAction func leftImgMovieClick(sender: AnyObject) {

        self.delegate.clickSecond_Movie(2)

    }

    @IBOutlet weak var midImg: UIImageView!

    @IBAction func midImgMovieClick(sender: AnyObject) {
        self.delegate.clickSecond_Movie(6)

    }
    @IBOutlet weak var rightImg: UIImageView!

    @IBAction func rightImgMovieClick(sender: AnyObject) {

        self.delegate.clickSecond_Movie(10)
    }

    @IBOutlet weak var rightLabelTitle: UILabel!

    @IBOutlet weak var rightLabelDetail: UILabel!

    @IBOutlet weak var midLabelTitle: UILabel!

    @IBOutlet weak var midLabelDetail: UILabel!

    @IBOutlet weak var leftLabelTitle: UILabel!
    
    @IBOutlet weak var leftLabelDetail: UILabel!

    @IBAction func titleClickMoreAction(sender: AnyObject){
        self.delegate.clickSecondTitle()
         print("标题")
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        let leftTap = UITapGestureRecognizer(target: self, action: "leftTap")
        leftImg.addGestureRecognizer(leftTap)

        let rightTap = UITapGestureRecognizer(target: self, action: "rightTap")
        rightImg.addGestureRecognizer(rightTap)

        let midTap = UITapGestureRecognizer(target: self, action: "midTap")
        midImg.addGestureRecognizer(midTap)

        // Initialization code
    }

    func leftTap(){
        self.delegate.clickSecondImage(1)

    }

    func rightTap(){
        self.delegate.clickSecondImage(5)
        
    }

    func midTap(){
        self.delegate.clickSecondImage(9)

    }


    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
